package demo11.gumballstate;

public class HasQuarterState implements State {
	GumballMachine gumballMachine;
	 
	public HasQuarterState(GumballMachine gumballMachine) {
		this.gumballMachine = gumballMachine;
	}
  
	public void insertQuarter() {
		System.out.println("你不能投入另一个25分");
	}
 
	public void ejectQuarter() {
		System.out.println("已经退还25分");
		gumballMachine.setState(gumballMachine.getNoQuarterState());
	}
 
	public void turnCrank() {
		System.out.println("得到糖果...");
		gumballMachine.setState(gumballMachine.getSoldState());
	}

    public void dispense() {
    	 System.out.println("没有糖果分配了");
    }
    
    public void refill() { }
 
	public String toString() {
		return "等待转动曲柄";
	}
}
